#测试帮助中心的所有内容是否可以打开
import time
from functools import wraps

from selenium.webdriver.common.by import By
from common.Utils import CloudDriver

class Help:
    url=""
    driver=""
    def __init__(self):
        self.url="http://vnollx.cloud/homepage"
        self.driver=CloudDriver.driver
        self.driver.get(self.url)

    def HelpWord(self):
        #先进入该页面
        self.driver.find_element(By.CSS_SELECTOR,"#helplink").click()
        #切换上下文进入iframe
        # 切换
        iframe = self.driver.find_element(By.TAG_NAME, "iframe")
        self.driver.switch_to.frame(iframe)
        #查看
        self.driver.find_element(By.CSS_SELECTOR,"body > div.main-container > div.left-section > ul > li:nth-child(1)").click()
        time.sleep(2)
        word=self.driver.find_element(By.CSS_SELECTOR,"#user-agreement > div > h2").text
        print(word)
        assert word=="用户协议"
        self.driver.find_element(By.CSS_SELECTOR,"#user-agreement > div > span").click()
